const fs=require('fs')
let user = { username:"admin1",password:"12345" }

let result=fs.readFileSync('shuju.json',{encoding:'utf8'})
//字符串形式获取数据
let res=Object.values(JSON.parse(result))
//字符串转数组
let a=res.findIndex(item=>item.username==user.username&&item.password==user.password
)
if(a==-1){
    console.log('账号不正确或未注册');
}else {
    console.log('登录成功');
}